<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .focus {
            width: 750px;
            height: 150px;
            background-color: cadetblue;
            margin: 100 auto;
        }
    </style>
    <!-- jquery 必须先引入 -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <!-- 引入 bootstrap 的 js 和 CSSS -->
    <script src="./bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="./bootstrap-3.4.1-dist/css/bootstrap.min.css">
</head>

<body>
    <div class="focus">
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
            <!-- 小圆圈效果 -->
            <ol class="carousel-indicators">
                <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                <li data-target="#carousel-example-generic" data-slide-to="2"></li>
            </ol>

            <!-- 轮播图主体 -->
            <div class="carousel-inner" role="listbox">
                <div class="item active">
                    <img src="upload/1.png" alt="故宫">
                    <div class="carousel-caption">
                        故宫
                    </div>
                </div>
                <div class="item">
                    <img src="upload/2.png" alt="山水">
                    <div class="carousel-caption">
                        山水
                    </div>
                </div>
                <div class="item">
                    <img src="upload/3.png" alt="清明上河图">
                    <div class="carousel-caption">
                        清明上河图
                    </div>
                </div>
            </div>

            <!-- 按钮 -->
            <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>
    </div>

    <script>
        /*
            使用步骤:
                1. 登录官网，查看效果和使用说明。
                2. 下载
                3. 引入 CSS H5 JS
                4. 调试 CSS H5 JS
        */
        //  初始化轮播图
        $('.carousel').carousel({
            interval: 2000
        });
    </script>
</body>

</html>